]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
i18n: Add context to "Power mode" title string
authorDavide Ferracin <davide.ferracin@protonmail.com>
Tue, 7 Oct 2025 12:45:45 +0000 (14:45 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 15 Oct 2025 00:08:07 +0000 (00:08 +0000)
The "Power mode" string in the quick settings menu appears both in the
title of the button and as the menu header that opens when clicking on
such button.
Currently they are translated together, but---at least in
Italian---the standard translation, "Modalità energia", is too long to
fit in the button and is very often truncated to "Modalità…" (aka
"Mode", in English) from which is not clear what the menu is about.
We would use "Energia" for the button title, but at the same time it
would be nice to have the full "Modalità energia" translation in the
menu header, where there is more space available.

For this reason I propose to add contexts to the two "Power mode"
strings, so that the string can be translated in different ways
depending on its position.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3903>

js/ui/status/powerProfiles.js

index 31877209c1fcb10d45a8647dd71d513abec36cdd..ebaf1f8ea91a442636403e3ef60cda27ce369f89 100644 (file)
@@ -42,7 +42,7 @@ const PowerProfilesToggle = GObject.registerClass(
 class PowerProfilesToggle extends QuickMenuToggle {
     _init() {
         super._init({
-            title: _('Power Mode'),
+            title: C_('Quick settings button title', 'Power Mode'),
             menuButtonAccessibleName: _('Open power profiles menu'),
         });
 
@@ -74,7 +74,7 @@ class PowerProfilesToggle extends QuickMenuToggle {
 
         this._profileSection = new PopupMenu.PopupMenuSection();
         this.menu.addMenuItem(this._profileSection);
-        this.menu.setHeader('power-profile-balanced-symbolic', _('Power Mode'));
+        this.menu.setHeader('power-profile-balanced-symbolic', C_('Quick settings menu header', 'Power Mode'));
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
         this.menu.addSettingsAction(_('Power Settings'),
             'gnome-power-panel.desktop');